Skip to content

Fix panic when resources root path is not the working directory#112

Merged
oxtoacart merged 1 commit intogetlantern:masterfrom
ksubileau:patch-1
Dec 9, 2019
Merged

Fix panic when resources root path is not the working directory#112
oxtoacart merged 1 commit intogetlantern:masterfrom
ksubileau:patch-1

Conversation

@ksubileau
Copy link
Contributor

@ksubileau ksubileau commented Dec 9, 2019

On Windows, Walk look for the icon in its resources root path, but systray write it to the current working directory.
The current working directory is the default root path, but it may be changed by external code (walk.Resources.SetRootDirPath()).
In this case, systray panic because walk can't find the temporary icon.

This PR fix this issue by writing the icon to the correct resources root path.

My personal use case is to set the resources root path to os.TempDir() to avoid a panic in case of the current working directory is not writable.

@oxtoacart
Copy link
Contributor

Thanks @ksubileau!

@oxtoacart oxtoacart merged commit 92663d2 into getlantern:master Dec 9, 2019
@ksubileau ksubileau deleted the patch-1 branch December 10, 2019 08:39
ropog3ovomou pushed a commit to ropog3ovomou/systray that referenced this pull request Jul 13, 2022
Fix panic when resources root path is not the working directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants